package com.itheima.demo.demo12;

import java.util.function.Predicate;

public class LamdaPredic {
    public static void main(String[] args) {
       method((s)->{
           if(s.startsWith("张")){
               return true;
           }else {
               return false;
           }
       });
    }

    private static void method(Predicate<String>n) {
        boolean b = n.test("张自强");
        if(b){
            System.out.println("有效");
        }else {
            System.out.println("无效");
        }
    }

}
